libxl: Fix if{} nesting in do_pci_remove
authorIan Jackson <iwj@mariner.uk.xensource.com>
Fri, 14 Nov 2014 14:41:38 +0000 (14:41 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Mon, 5 Jan 2015 16:45:13 +0000 (16:45 +0000)
commit7ca2558c048c7d5d2a6d401e58181a06a00f9eeb
tree030da870b91a684e0a13b7f62cba1efa3547550d
parent6b511af68618a86d5a2258e649042a3f0b8ace52
libxl: Fix if{} nesting in do_pci_remove

do_pci_remove contained this:

    if (type == LIBXL_DOMAIN_TYPE_HVM) {
       [stuff]
    } else if (type != LIBXL_DOMAIN_TYPE_PV)
        abort();
    {

This is bizarre, and not correct.  The effect is that HVM guests end
up running both the proper code and that intended for PV guests.  This
causes (amongst other things) trouble when PCI devices are
hot-unplugged from HVM guests.

This bug was introduced in abfb006f "tools/libxl: explicitly grant
access to needed I/O-memory ranges".

This is clear candidate for Xen 4.5, being a bugfix to an important
feature.

Reported-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Tested-by: Robert Hu <robert.hu@intel.com>
Rlease-Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
CC: Sander Eikelenboom <linux@eikelenboom.it>
CC: George Dunlap <George.Dunlap@eu.citrix.com>
tools/libxl/libxl_pci.c